package com.cskaoyan.day1.generic1;

/**
 * @author Common-zhou
 * @since 2023-02-27 09:42
 */
public class AutoCarDemo {
    public static void main(String[] args) {
        //AutoCar autoCar = new AutoCar();
        //
        //autoCar.run();

        // 车库类
        //AutoCarHolder autoCarHolder = getAutoCarHolder();
        AutoCarHolder autoCarHolder = new AutoCarHolder(new AutoCar());

        AutoCar autoCar = autoCarHolder.get();

        autoCar.run();


    }

    private static AutoCarHolder getAutoCarHolder() {

        AutoCar autoCar = new AutoCar();

        // 有没有可能 小汽车的建造非常的麻烦。

        AutoCarHolder autoCarHolder = new AutoCarHolder(autoCar);

        return autoCarHolder;
    }
}
